<template>
  <div class="plan-detail">
    <el-table :data="detailData" border height="500">
      <el-table-column prop="ProcessName" label="工序" width="150" />
      <el-table-column prop="PlanDate" label="计划日期" width="120" />
      <el-table-column prop="RequiredQty" label="需求数量" width="100" />
      <el-table-column prop="StockQty" label="库存数量" width="100" />
      <el-table-column prop="ShortageQty" label="缺口数量" width="100" />
      <!-- 其他列 -->
    </el-table>
    
    <div class="actions">
      <el-button @click="exportData">导出Excel</el-button>
    </div>
  </div>
</template>

<script>
export default {
  props: ['planId', 'materialCode'],
  data() {
    return {
      detailData: [] // 计划详情数据
    }
  },
  mounted() {
    this.loadData();
  },
  methods: {
    async loadData() {
      try {
        const response = await this.$http.get(
          'api/material_plan_detail', 
          { params: { planId: this.planId } }
        );
        this.detailData = response.data;
      } catch (error) {
        this.$Message.error('加载详情失败');
      }
    },
    
    exportData() {
      // 导出逻辑
    }
  }
}
</script>

<style scoped>
.plan-detail {
  padding: 15px;
}
.actions {
  margin-top: 20px;
  text-align: right;
}
</style>